package cn.enjoy.design.create.factory.factoryMethod;

/**
 * 来到一家餐馆，点菜吃饭
 * @author K
 * @date 2020/11/9 15:25
 */
public class SimpleRestaurantFactory {
    public static final int HD = 1;
    public static final int MT = 2;
    public static final int SJ = 3;

    public static AbstractFood createFood(int foodType) {
        switch (foodType) {
            case HD:
                return new HunDun();
            case MT:
                return new MianTiao();
            default:
                return new ShuiJiao();
        }
    }

    public static void main(String[] args) {
        AbstractFood food = SimpleRestaurantFactory.createFood(2);
        food.desc();
    }
}
